﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IankerProj.Models;

namespace IankerProj.Controllers
{
    public class MenuController : Controller
    {
        AnkerDBEntities db = new AnkerDBEntities();
        //
        // GET: /Menu/

        public ActionResult Index()
        {
            var p = db.Sanphams.Where(c => c.idcha == 0).ToList();
            return View(p);
        }
        public ActionResult Menucon(int id)
        {
            var p = db.Sanphams.Where(c => c.idcha == id).ToList();
            return View(p);
        }
        public ActionResult Thietbicha()
        {
            var p = db.Danhmucs.Where(c => c.idcha == 0).ToList();
            return View(p);
        }
        public ActionResult Thietbicon(int id)
        {
            var p = db.Danhmucs.Where(c => c.idcha == id).ToList();
            return View(p);
        }
    }
}
